package com.boc.ewr.util.file.enumeration;

import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.Optional;

/**
 * 条线考核内容
 */
@Slf4j
public enum LineCheckContentEnum {
    CONTROLMAIL("11", "对账指标-邮寄渠道控制率"),
    KEYBILL("12", "对账指标-重点账单回执率"),
    RECEIPTRATE("13", "对账指标-非重点账单回执率"),
    TIMELINESSRATE("14", "对账指标-签约及时率考核"),
    COMPLETIONRATE("15", "对账指标-上门对账完成率"),

    SUPPLEMENT("33", "加分项-其他线上补充加分项"),
    IMPROVE("32", "加分项-手机银行客户提升值"),
    UPGRADING("31", "加分项-B类账户提质加分"),
    NONPROFESSIONAL("29", "对账管理-风险管控-条线检查-网点引导客户在非专用内网IP上的对账"),
    DISCOVER("28", "对账管理-风险管控-条线检查-现场或非现场发现问题"),
    VIOLATION("27", "对账管理-风险管控-条线检查-违反“三分离、四严禁”的其他规定的"),
    NOPROINREC("26", "对账管理-风险管控-条线检查-无二级分支行对账人员参与的上门对账"),
    ONLINE("25", "对账管理-风险管控-网银、手机对账检查"),
    SPOTCHECK("24", "对账管理-条线履职-省行抽检"),
    RECTIFICATION("23", "对账管理-条线履职-整改及时性"),
    FEEDBACK("22", "对账管理-条线履职-风险核查反馈"),
    REPORT("21", "对账管理-条线履职-季度报告");

    private String index;
    private String value;
    LineCheckContentEnum(String index, String value) {
        this.index = index;
        this.value = value;
    }

    /**
     * 根据value获取枚举对象
     *
     * @param index
     * @return
     */
    public static LineCheckContentEnum getEnumByIndex(String index) {
        Optional<LineCheckContentEnum> first = Arrays.stream(LineCheckContentEnum.values()).filter(e -> e.getIndex().equals(index)).findFirst();
        LineCheckContentEnum expEnum = first.orElse(null);
        log.info("选择的枚举类型是：" + expEnum.toString());
        return expEnum;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
